﻿using System.Linq;
using System.ServiceModel.DomainServices.EntityFramework;
using System.ServiceModel.DomainServices.Hosting;
using System.ServiceModel.DomainServices.Server;
using caedisi.Web.DataModel;

namespace caedisi.Web.Services
{
    /// <summary>
    /// A partial class that extends the functionality of the CellularAutomataDomainService
    /// </summary>
    public partial class CellularAutomataDomainService
    {
        /// <summary>
        /// Gets the cellular automata with children.
        /// </summary>
        /// <param name="cellularAutomataId">The cellular automata id.</param>
        /// <returns></returns>
        public IQueryable<CellularAutomata> GetCellularAutomataWithChildren()
        {
            return this.ObjectContext.CellularAutomatas.Include("RecordStates").Include("Cells").Include("TransitionRules").Include("TransitionRules.NeighbourhoodStateConfigurations") .AsQueryable();
        }        
    }
}